<script>
    let processArray = (arr, processor) => {
    let result = [];
    for (let i = 0; i < arr.length; i++) {
        const element = arr[i];
        const processorResult = processor(element, i);
        if (processorResult === true) {
            result.unshift(element); 
        } else if (processorResult === false) {
            result.push(element); 
        }
    }
    return result;
};
</script>
